package com.tienon.message.Test;

import java.util.Date;

import javax.annotation.Resource;

import org.junit.Test;
import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.transaction.annotation.Transactional;

import com.tienon.message.entity.Push_App;
import com.tienon.message.mapper.Push_AppMapper;
import com.tienon.message.mapper.Raw_msg_batchMapper;
import com.tienon.message.thread.task.AppSendMsgTask;
import com.tienon.message.util.SpringUtil;

public class TestSpringUtil {

	
	/*@Resource
	SqlSessionTemplate s ;
	
	@Resource
	Push_AppMapper dao;*/
	
	@Test
	public void testGetDao() throws Exception {

		//System.out.println(dao);
		System.out.println("====1!!!!");
		//System.out.println(s);
		//Raw_msg_batchMapper dao = SpringUtil.getDao(Raw_msg_batchMapper.class);

		//System.out.println(dao);
		//dao = SpringUtil.getDao(Raw_msg_batchMapper.class);

		
		//System.out.println(dao);
		AppSendMsgTask task = SpringUtil.getTask("appSendMsgTask", new Push_App());
		System.out.println(task);
		SqlSessionTemplate ss = SpringUtil.getDao(SqlSessionTemplate.class);
		System.out.println(ss);
		task = SpringUtil.getTask("appSendMsgTask", new Push_App());
		System.out.println(task);
		task = SpringUtil.getTask("appSendMsgTask", new Push_App());		
		System.out.println(task);
		Push_App app = new Push_App();
		app.setBatId(888);
		app.setSerial(888);
		app.setSplitId(1);
		app.setFilter(1);
		app.setOccDate(new Date());
		app.setFee(100);
		app.setSendNow(1);
		app.setSendTime(new Date());
		app.setSplitTotal(111);
		app.setMsgType(1);
		app.setMsg("TEST");
		app.setSplitFlag(1);
		app.setSendWay(1);
		app.setBsnCd("123456");
		app.setSendTimes(1);
		app.setFeeType(1);
		app.setOutChannle("1");
		app.setPrior(1);
		app.setReportFlag(1);
		app.setOccDate(new Date());
		app.setLinkFlag(1);
		app.setState(1);
		app.setOccTime(new Date());
		app.setOutChanCustomId("2");
		task = SpringUtil.getTask("appSendMsgTask", app);		
		System.out.println(task);
		task.call();
		
	}

}
